GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Sparse-C.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2004-2017 David Bateman
4 Copyright (C) 1998-2004 Andy Adler
5 
6 This file is part of Octave.
7 
8 Octave is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with Octave; see the file COPYING. If not, see
20 <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #if defined (HAVE_CONFIG_H)
25 # include "config.h"
26 #endif
27 
28 // Instantiate Sparse matrix of complex values.
29 
30 #include "oct-cmplx.h"
31 #include "lo-mappers.h"
32 #include "lo-ieee.h"
33 #include "Sparse.h"
34 #include "Sparse.cc"
35 
36 
37 static double
38 xabs (const Complex& x)
39 {
40  return ((octave::math::isinf (x.real ()) || octave::math::isinf (x.imag ()))
42 }
43 
44 template <>
45 bool
47 {
48  return (octave::math::isnan (b) || (xabs (a) < xabs (b))
49  || ((xabs (a) == xabs (b)) && (arg (a) < arg (b))));
50 }
51 
52 template <>
53 bool
55 {
56  return (octave::math::isnan (a) || (xabs (a) > xabs (b))
57  || ((xabs (a) == xabs (b)) && (arg (a) > arg (b))));
58 }
59 
61 
62 #if 0
63 template std::ostream& operator << (std::ostream&, const Sparse<Complex>&);
64 #endif
static double xabs(const Complex &x)
Definition: Sparse-C.cc:38
bool isnan(double x)
Definition: lo-mappers.cc:347
octave_value arg
Definition: pr-output.cc:3440
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Definition: cellfun.cc:398
#define INSTANTIATE_SPARSE(T, API)
Definition: Sparse.cc:3012
bool isinf(double x)
Definition: lo-mappers.cc:387
#define Inf
Definition: Faddeeva.cc:247
bool sparse_descending_compare< Complex >(const Complex &a, const Complex &b)
Definition: Sparse-C.cc:54
OCTAVE_EXPORT octave_value_list return the value of the option it must match the dimension of the state and the relative tolerance must also be a vector of the same length tem it must match the dimension of the state and the absolute tolerance must also be a vector of the same length The local error test applied at each integration step is xample roup abs(local error in x(i))<
b
Definition: cellfun.cc:398
std::complex< double > Complex
Definition: oct-cmplx.h:31
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE * x
bool sparse_ascending_compare< Complex >(const Complex &a, const Complex &b)
Definition: Sparse-C.cc:46