GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
CSparse.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2004-2018 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
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License 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 <https://www.gnu.org/licenses/>.
21 
22 */
23 
24 #if ! defined (octave_CSparse_h)
25 #define octave_CSparse_h 1
26 
27 #include "octave-config.h"
28 
29 #include "CColVector.h"
30 #include "CMatrix.h"
31 #include "CNDArray.h"
32 #include "DET.h"
33 #include "MSparse.h"
34 #include "MatrixType.h"
35 #include "Sparse-op-decls.h"
36 #include "dColVector.h"
37 #include "dMatrix.h"
38 #include "dNDArray.h"
39 #include "oct-cmplx.h"
40 
41 class PermMatrix;
42 class DiagMatrix;
43 class ComplexDiagMatrix;
44 class SparseMatrix;
45 class SparseBoolMatrix;
46 
47 class
48 OCTAVE_API
50 {
51 public:
52 
53  // Corresponding dense matrix type for this sparse matrix type.
55 
56  typedef void (*solve_singularity_handler) (double rcond);
57 
59 
61  octave_idx_type c) : MSparse<Complex> (r, c) { }
62 
64  : MSparse<Complex> (dv, nz) { }
65 
67  Complex val)
68  : MSparse<Complex> (r, c, val) { }
69 
71  : MSparse<Complex> (r, c, Complex (val)) { }
72 
74  : MSparse<Complex> (a) { }
75 
77  : MSparse<Complex> (a, dv) { }
78 
80 
82 
84  : MSparse<Complex> (a) { }
85 
87  : MSparse<Complex> (a) { }
88 
90  const idx_vector& c, octave_idx_type nr = -1,
91  octave_idx_type nc = -1, bool sum_terms = true,
92  octave_idx_type nzm = -1)
93  : MSparse<Complex> (a, r, c, nr, nc, sum_terms, nzm) { }
94 
95  explicit SparseComplexMatrix (const SparseMatrix& a);
96 
97  explicit SparseComplexMatrix (const SparseBoolMatrix& a);
98 
99  explicit SparseComplexMatrix (const ComplexDiagMatrix& a);
100 
102  octave_idx_type num_nz)
103  : MSparse<Complex> (r, c, num_nz) { }
104 
106  {
108  return *this;
109  }
110 
111  bool operator == (const SparseComplexMatrix& a) const;
112  bool operator != (const SparseComplexMatrix& a) const;
113 
114  bool ishermitian (void) const;
115 
116  OCTAVE_DEPRECATED (4.4, "use 'ishermitian' instead")
117  bool is_hermitian (void) const
118  { return ishermitian (); }
119 
120  SparseComplexMatrix max (int dim = -1) const;
121  SparseComplexMatrix max (Array<octave_idx_type>& index, int dim = -1) const;
122  SparseComplexMatrix min (int dim = -1) const;
123  SparseComplexMatrix min (Array<octave_idx_type>& index, int dim = -1) const;
124 
130  const Array<octave_idx_type>& indx);
132  const Array<octave_idx_type>& indx);
133 
138 
139  ComplexMatrix matrix_value (void) const;
140 
141  SparseComplexMatrix hermitian (void) const; // complex conjugate transpose
143  { return MSparse<Complex>::transpose (); }
144 
146 
147  // extract row or column i.
148 
150 
152 
153 private:
154  SparseComplexMatrix dinverse (MatrixType& mattype, octave_idx_type& info,
155  double& rcond, const bool force = false,
156  const bool calccond = true) const;
157 
158  SparseComplexMatrix tinverse (MatrixType& mattype, octave_idx_type& info,
159  double& rcond, const bool force = false,
160  const bool calccond = true) const;
161 
162 public:
163  SparseComplexMatrix inverse (void) const;
164  SparseComplexMatrix inverse (MatrixType& mattype) const;
165  SparseComplexMatrix inverse (MatrixType& mattype,
166  octave_idx_type& info) const;
167  SparseComplexMatrix inverse (MatrixType& mattype, octave_idx_type& info,
168  double& rcond, bool force = false,
169  bool calc_cond = true) const;
170 
171  ComplexDET determinant (void) const;
172  ComplexDET determinant (octave_idx_type& info) const;
173  ComplexDET determinant (octave_idx_type& info, double& rcond,
174  bool calc_cond = true) const;
175 
176 private:
177  // Diagonal matrix solvers
178  ComplexMatrix dsolve (MatrixType& mattype, const Matrix& b,
179  octave_idx_type& info, double& rcond,
180  solve_singularity_handler sing_handler,
181  bool calc_cond = false) const;
182 
183  ComplexMatrix dsolve (MatrixType& mattype, const ComplexMatrix& b,
184  octave_idx_type& info, double& rcond,
185  solve_singularity_handler sing_handler,
186  bool calc_cond = false) const;
187 
188  SparseComplexMatrix dsolve (MatrixType& mattype, const SparseMatrix& b,
189  octave_idx_type& info, double& rcond,
190  solve_singularity_handler sing_handler,
191  bool calc_cond = false) const;
192 
193  SparseComplexMatrix dsolve (MatrixType& mattype, const SparseComplexMatrix& b,
194  octave_idx_type& info, double& rcond,
195  solve_singularity_handler sing_handler,
196  bool calc_cond = false) const;
197 
198  // Upper triangular matrix solvers
199  ComplexMatrix utsolve (MatrixType& mattype, const Matrix& b,
200  octave_idx_type& info, double& rcond,
201  solve_singularity_handler sing_handler,
202  bool calc_cond = false) const;
203 
204  ComplexMatrix utsolve (MatrixType& mattype, const ComplexMatrix& b,
205  octave_idx_type& info, double& rcond,
206  solve_singularity_handler sing_handler,
207  bool calc_cond = false) const;
208 
210  octave_idx_type& info, double& rcond,
211  solve_singularity_handler sing_handler,
212  bool calc_cond = false) const;
213 
215  octave_idx_type& info, double& rcond,
216  solve_singularity_handler sing_handler,
217  bool calc_cond = false) const;
218 
219  // Lower triangular matrix solvers
220  ComplexMatrix ltsolve (MatrixType& mattype, const Matrix& b,
221  octave_idx_type& info, double& rcond,
222  solve_singularity_handler sing_handler,
223  bool calc_cond = false) const;
224 
225  ComplexMatrix ltsolve (MatrixType& mattype, const ComplexMatrix& b,
226  octave_idx_type& info, double& rcond,
227  solve_singularity_handler sing_handler,
228  bool calc_cond = false) const;
229 
231  octave_idx_type& info, double& rcond,
232  solve_singularity_handler sing_handler,
233  bool calc_cond = false) const;
234 
236  octave_idx_type& info, double& rcond,
237  solve_singularity_handler sing_handler,
238  bool calc_cond = false) const;
239 
240  // Tridiagonal matrix solvers
241  ComplexMatrix trisolve (MatrixType& mattype, const Matrix& b,
242  octave_idx_type& info, double& rcond,
243  solve_singularity_handler sing_handler,
244  bool calc_cond = false) const;
245 
246  ComplexMatrix trisolve (MatrixType& mattype, const ComplexMatrix& b,
247  octave_idx_type& info, double& rcond,
248  solve_singularity_handler sing_handler,
249  bool calc_cond = false) const;
250 
251  SparseComplexMatrix trisolve (MatrixType& mattype, const SparseMatrix& b,
252  octave_idx_type& info, double& rcond,
253  solve_singularity_handler sing_handler,
254  bool calc_cond = false) const;
255 
256  SparseComplexMatrix trisolve (MatrixType& mattype, const SparseComplexMatrix& b,
257  octave_idx_type& info, double& rcond,
258  solve_singularity_handler sing_handler,
259  bool calc_cond = false) const;
260 
261  // Banded matrix solvers (umfpack/cholesky)
262  ComplexMatrix bsolve (MatrixType& mattype, const Matrix& b,
263  octave_idx_type& info, double& rcond,
264  solve_singularity_handler sing_handler,
265  bool calc_cond = false) const;
266 
267  ComplexMatrix bsolve (MatrixType& mattype, const ComplexMatrix& b,
268  octave_idx_type& info, double& rcond,
269  solve_singularity_handler sing_handler,
270  bool calc_cond = false) const;
271 
272  SparseComplexMatrix bsolve (MatrixType& mattype, const SparseMatrix& b,
273  octave_idx_type& info, double& rcond,
274  solve_singularity_handler sing_handler,
275  bool calc_cond = false) const;
276 
277  SparseComplexMatrix bsolve (MatrixType& mattype, const SparseComplexMatrix& b,
278  octave_idx_type& info, double& rcond,
279  solve_singularity_handler sing_handler,
280  bool calc_cond = false) const;
281 
282  // Full matrix solvers (umfpack/cholesky)
283  void * factorize (octave_idx_type& err, double& rcond, Matrix& Control,
284  Matrix& Info, solve_singularity_handler sing_handler,
285  bool calc_cond) const;
286 
287  ComplexMatrix fsolve (MatrixType& mattype, const Matrix& b,
288  octave_idx_type& info, double& rcond,
289  solve_singularity_handler sing_handler,
290  bool calc_cond = false) const;
291 
292  ComplexMatrix fsolve (MatrixType& mattype, const ComplexMatrix& b,
293  octave_idx_type& info, double& rcond,
294  solve_singularity_handler sing_handler,
295  bool calc_cond = false) const;
296 
297  SparseComplexMatrix fsolve (MatrixType& mattype, const SparseMatrix& b,
298  octave_idx_type& info, double& rcond,
299  solve_singularity_handler sing_handler,
300  bool calc_cond = false) const;
301 
302  SparseComplexMatrix fsolve (MatrixType& mattype, const SparseComplexMatrix& b,
303  octave_idx_type& info, double& rcond,
304  solve_singularity_handler sing_handler,
305  bool calc_cond = false) const;
306 
307 public:
308  // Generic interface to solver with no probing of type
309  ComplexMatrix solve (MatrixType& mattype, const Matrix& b) const;
310  ComplexMatrix solve (MatrixType& mattype, const Matrix& b,
311  octave_idx_type& info) const;
312  ComplexMatrix solve (MatrixType& mattype, const Matrix& b,
313  octave_idx_type& info, double& rcond) const;
314  ComplexMatrix solve (MatrixType& mattype, const Matrix& b,
315  octave_idx_type& info,
316  double& rcond, solve_singularity_handler sing_handler,
317  bool singular_fallback = true) const;
318 
319  ComplexMatrix solve (MatrixType& mattype, const ComplexMatrix& b) const;
320  ComplexMatrix solve (MatrixType& mattype, const ComplexMatrix& b,
321  octave_idx_type& info) const;
322  ComplexMatrix solve (MatrixType& mattype, const ComplexMatrix& b,
323  octave_idx_type& info, double& rcond) const;
324  ComplexMatrix solve (MatrixType& mattype, const ComplexMatrix& b,
325  octave_idx_type& info, double& rcond,
326  solve_singularity_handler sing_handler,
327  bool singular_fallback = true) const;
328 
329  SparseComplexMatrix solve (MatrixType& mattype, const SparseMatrix& b) const;
330  SparseComplexMatrix solve (MatrixType& mattype, const SparseMatrix& b,
331  octave_idx_type& info) const;
332  SparseComplexMatrix solve (MatrixType& mattype, const SparseMatrix& b,
333  octave_idx_type& info, double& rcond) const;
334  SparseComplexMatrix solve (MatrixType& mattype, const SparseMatrix& b,
335  octave_idx_type& info, double& rcond,
336  solve_singularity_handler sing_handler,
337  bool singular_fallback = true) const;
338 
339  SparseComplexMatrix solve (MatrixType& mattype,
340  const SparseComplexMatrix& b) const;
341  SparseComplexMatrix solve (MatrixType& mattype, const SparseComplexMatrix& b,
342  octave_idx_type& info) const;
343  SparseComplexMatrix solve (MatrixType& mattype, const SparseComplexMatrix& b,
344  octave_idx_type& info, double& rcond) const;
345  SparseComplexMatrix solve (MatrixType& mattype, const SparseComplexMatrix& b,
346  octave_idx_type& info, double& rcond,
347  solve_singularity_handler sing_handler,
348  bool singular_fallback = true) const;
349 
350  ComplexColumnVector solve (MatrixType& mattype, const ColumnVector& b) const;
351  ComplexColumnVector solve (MatrixType& mattype, const ColumnVector& b,
352  octave_idx_type& info) const;
353  ComplexColumnVector solve (MatrixType& mattype, const ColumnVector& b,
354  octave_idx_type& info, double& rcond) const;
355  ComplexColumnVector solve (MatrixType& mattype, const ColumnVector& b,
356  octave_idx_type& info, double& rcond,
357  solve_singularity_handler sing_handler) const;
358 
359  ComplexColumnVector solve (MatrixType& mattype,
360  const ComplexColumnVector& b) const;
361  ComplexColumnVector solve (MatrixType& mattype, const ComplexColumnVector& b,
362  octave_idx_type& info) const;
363  ComplexColumnVector solve (MatrixType& mattype, const ComplexColumnVector& b,
364  octave_idx_type& info, double& rcond) const;
365  ComplexColumnVector solve (MatrixType& mattype, const ComplexColumnVector& b,
366  octave_idx_type& info, double& rcond,
367  solve_singularity_handler sing_handler) const;
368 
369  // Generic interface to solver with probing of type
370  ComplexMatrix solve (const Matrix& b) const;
371  ComplexMatrix solve (const Matrix& b, octave_idx_type& info) const;
372  ComplexMatrix solve (const Matrix& b, octave_idx_type& info,
373  double& rcond) const;
374  ComplexMatrix solve (const Matrix& b, octave_idx_type& info, double& rcond,
375  solve_singularity_handler sing_handler) const;
376 
377  ComplexMatrix solve (const ComplexMatrix& b) const;
378  ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info) const;
379  ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info,
380  double& rcond) const;
381  ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info,
382  double& rcond,
383  solve_singularity_handler sing_handler) const;
384 
385  SparseComplexMatrix solve (const SparseMatrix& b) const;
386  SparseComplexMatrix solve (const SparseMatrix& b,
387  octave_idx_type& info) const;
388  SparseComplexMatrix solve (const SparseMatrix& b, octave_idx_type& info,
389  double& rcond) const;
390  SparseComplexMatrix solve (const SparseMatrix& b, octave_idx_type& info,
391  double& rcond,
392  solve_singularity_handler sing_handler) const;
393 
394  SparseComplexMatrix solve (const SparseComplexMatrix& b) const;
396  octave_idx_type& info) const;
398  octave_idx_type& info, double& rcond) const;
400  octave_idx_type& info, double& rcond,
401  solve_singularity_handler sing_handler) const;
402 
403  ComplexColumnVector solve (const ColumnVector& b) const;
404  ComplexColumnVector solve (const ColumnVector& b,
405  octave_idx_type& info) const;
406  ComplexColumnVector solve (const ColumnVector& b, octave_idx_type& info,
407  double& rcond) const;
408  ComplexColumnVector solve (const ColumnVector& b, octave_idx_type& info,
409  double& rcond,
410  solve_singularity_handler sing_handler) const;
411 
412  ComplexColumnVector solve (const ComplexColumnVector& b) const;
414  octave_idx_type& info) const;
416  octave_idx_type& info, double& rcond) const;
418  octave_idx_type& info, double& rcond,
419  solve_singularity_handler sing_handler) const;
420 
421  SparseComplexMatrix squeeze (void) const;
422 
423  SparseComplexMatrix reshape (const dim_vector& new_dims) const;
424 
426  bool inv = false) const;
427 
429 
430  bool any_element_is_nan (void) const;
431  bool any_element_is_inf_or_nan (void) const;
432  bool all_elements_are_real (void) const;
433  bool all_integers (double& max_val, double& min_val) const;
434  bool too_large_for_float (void) const;
435 
436  SparseBoolMatrix operator ! (void) const;
437 
438  SparseBoolMatrix all (int dim = -1) const;
439  SparseBoolMatrix any (int dim = -1) const;
440 
441  SparseComplexMatrix cumprod (int dim = -1) const;
442  SparseComplexMatrix cumsum (int dim = -1) const;
443  SparseComplexMatrix prod (int dim = -1) const;
444  SparseComplexMatrix sum (int dim = -1) const;
445  SparseComplexMatrix sumsq (int dim = -1) const;
446  SparseMatrix abs (void) const;
447 
449 
450  // i/o
451  friend OCTAVE_API std::ostream& operator << (std::ostream& os,
452  const SparseComplexMatrix& a);
453  friend OCTAVE_API std::istream& operator >> (std::istream& is,
455 };
456 
457 extern OCTAVE_API SparseComplexMatrix operator * (const SparseMatrix&,
458  const SparseComplexMatrix&);
459 extern OCTAVE_API SparseComplexMatrix operator * (const SparseComplexMatrix&,
460  const SparseMatrix&);
461 extern OCTAVE_API SparseComplexMatrix operator * (const SparseComplexMatrix&,
462  const SparseComplexMatrix&);
463 
464 extern OCTAVE_API ComplexMatrix operator * (const Matrix&,
465  const SparseComplexMatrix&);
466 extern OCTAVE_API ComplexMatrix operator * (const ComplexMatrix&,
467  const SparseMatrix&);
468 extern OCTAVE_API ComplexMatrix operator * (const ComplexMatrix&,
469  const SparseComplexMatrix&);
470 extern OCTAVE_API ComplexMatrix mul_trans (const ComplexMatrix&,
471  const SparseComplexMatrix&);
472 extern OCTAVE_API ComplexMatrix mul_herm (const ComplexMatrix&,
473  const SparseComplexMatrix&);
474 
475 extern OCTAVE_API ComplexMatrix operator * (const SparseMatrix&,
476  const ComplexMatrix&);
477 extern OCTAVE_API ComplexMatrix operator * (const SparseComplexMatrix&,
478  const Matrix&);
479 extern OCTAVE_API ComplexMatrix operator * (const SparseComplexMatrix&,
480  const ComplexMatrix&);
481 extern OCTAVE_API ComplexMatrix trans_mul (const SparseComplexMatrix&,
482  const ComplexMatrix&);
483 extern OCTAVE_API ComplexMatrix herm_mul (const SparseComplexMatrix&,
484  const ComplexMatrix&);
485 
486 extern OCTAVE_API SparseComplexMatrix operator * (const DiagMatrix&,
487  const SparseComplexMatrix&);
488 extern OCTAVE_API SparseComplexMatrix operator * (const SparseComplexMatrix&,
489  const DiagMatrix&);
490 
491 extern OCTAVE_API SparseComplexMatrix operator * (const ComplexDiagMatrix&,
492  const SparseMatrix&);
493 extern OCTAVE_API SparseComplexMatrix operator * (const SparseMatrix&,
494  const ComplexDiagMatrix&);
495 
496 extern OCTAVE_API SparseComplexMatrix operator * (const ComplexDiagMatrix&,
497  const SparseComplexMatrix&);
498 extern OCTAVE_API SparseComplexMatrix operator * (const SparseComplexMatrix&,
499  const ComplexDiagMatrix&);
500 
501 extern OCTAVE_API SparseComplexMatrix operator + (const ComplexDiagMatrix&,
502  const SparseMatrix&);
503 extern OCTAVE_API SparseComplexMatrix operator + (const DiagMatrix&,
504  const SparseComplexMatrix&);
505 extern OCTAVE_API SparseComplexMatrix operator + (const ComplexDiagMatrix&,
506  const SparseComplexMatrix&);
507 extern OCTAVE_API SparseComplexMatrix operator + (const SparseMatrix&,
508  const ComplexDiagMatrix&);
509 extern OCTAVE_API SparseComplexMatrix operator + (const SparseComplexMatrix&,
510  const DiagMatrix&);
511 extern OCTAVE_API SparseComplexMatrix operator + (const SparseComplexMatrix&,
512  const ComplexDiagMatrix&);
513 
514 extern OCTAVE_API SparseComplexMatrix operator - (const ComplexDiagMatrix&,
515  const SparseMatrix&);
516 extern OCTAVE_API SparseComplexMatrix operator - (const DiagMatrix&,
517  const SparseComplexMatrix&);
518 extern OCTAVE_API SparseComplexMatrix operator - (const ComplexDiagMatrix&,
519  const SparseComplexMatrix&);
520 extern OCTAVE_API SparseComplexMatrix operator - (const SparseMatrix&,
521  const ComplexDiagMatrix&);
522 extern OCTAVE_API SparseComplexMatrix operator - (const SparseComplexMatrix&,
523  const DiagMatrix&);
524 extern OCTAVE_API SparseComplexMatrix operator - (const SparseComplexMatrix&,
525  const ComplexDiagMatrix&);
526 
527 extern OCTAVE_API SparseComplexMatrix operator * (const PermMatrix&,
528  const SparseComplexMatrix&);
529 extern OCTAVE_API SparseComplexMatrix operator * (const SparseComplexMatrix&,
530  const PermMatrix&);
531 
532 extern OCTAVE_API SparseComplexMatrix min (const Complex& c,
533  const SparseComplexMatrix& m);
534 extern OCTAVE_API SparseComplexMatrix min (const SparseComplexMatrix& m,
535  const Complex& c);
536 extern OCTAVE_API SparseComplexMatrix min (const SparseComplexMatrix& a,
537  const SparseComplexMatrix& b);
538 
539 extern OCTAVE_API SparseComplexMatrix max (const Complex& c,
540  const SparseComplexMatrix& m);
541 extern OCTAVE_API SparseComplexMatrix max (const SparseComplexMatrix& m,
542  const Complex& c);
543 extern OCTAVE_API SparseComplexMatrix max (const SparseComplexMatrix& a,
544  const SparseComplexMatrix& b);
545 
548 
551 
554 
556 
557 #endif
SparseComplexMatrix(const ComplexNDArray &a)
Definition: CSparse.h:86
SparseBoolMatrix reshape(const dim_vector &new_dims) const
Definition: boolSparse.cc:306
OCTAVE_EXPORT octave_value_list column
Definition: sparse.cc:123
#define SPARSE_SMSM_BOOL_OP_DECLS(M1, M2, API)
SparseComplexMatrix(const MSparse< Complex > &a)
Definition: CSparse.h:79
bool operator!=(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:566
const octave_base_value const Array< octave_idx_type > & ra_idx
SparseComplexMatrix transpose(void) const
Definition: CSparse.h:142
std::istream & operator>>(std::istream &is, SparseBoolMatrix &a)
Definition: boolSparse.cc:279
ComplexMatrix dense_matrix_type
Definition: CSparse.h:54
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:4986
boolMatrix matrix_value(void) const
Definition: boolSparse.cc:248
OCTAVE_API ComplexMatrix trans_mul(const SparseComplexMatrix &, const ComplexMatrix &)
Definition: CSparse.cc:7574
SparseBoolMatrix & operator=(const SparseBoolMatrix &a)
Definition: boolSparse.h:80
for large enough k
Definition: lu.cc:617
SparseBoolMatrix permute(const Array< octave_idx_type > &vec, bool inv=false) const
Definition: boolSparse.cc:312
ComplexNDArray concat(NDArray &ra, ComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
Definition: CNDArray.cc:653
SparseComplexMatrix(const dim_vector &dv, octave_idx_type nz=0)
Definition: CSparse.h:63
OCTAVE_API SparseComplexMatrix max(const Complex &c, const SparseComplexMatrix &m)
Definition: CSparse.cc:7819
static T abs(T x)
Definition: pr-output.cc:1696
#define SPARSE_SMS_CMP_OP_DECLS(M, S, API)
the second is matched to the second specifier and placed in the second column and so forth If there are more words than specifiers then the process is repeated until all words have been processed or the limit imposed by any(non-whitespace) text in the format that is not one of these specifiers is considered a literal. If there is a literal between two format specifiers then that same literal must appear in the input stream between the matching words. The following specifiers are valid
Definition: file-io.cc:1499
#define SPARSE_SMS_BOOL_OP_DECLS(M, S, API)
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
Definition: file-io.cc:587
#define SPARSE_FORWARD_DEFS(B, R, F, T)
Definition: MSparse.h:188
#define SPARSE_SSM_CMP_OP_DECLS(S, M, API)
SparseBoolMatrix ipermute(const Array< octave_idx_type > &vec) const
Definition: boolSparse.cc:318
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:400
SparseBoolMatrix diag(octave_idx_type k=0) const
Definition: boolSparse.cc:242
SparseComplexMatrix(void)
Definition: CSparse.h:58
SparseComplexMatrix(octave_idx_type r, octave_idx_type c)
Definition: CSparse.h:60
MSparse< T > transpose(void) const
Definition: MSparse.h:92
SparseComplexMatrix(const SparseComplexMatrix &a)
Definition: CSparse.h:73
ComplexColumnVector conj(const ComplexColumnVector &a)
Definition: CColVector.cc:215
#define SPARSE_SMSM_CMP_OP_DECLS(M1, M2, API)
#define SPARSE_SSM_BOOL_OP_DECLS(S, M, API)
SparseComplexMatrix(octave_idx_type r, octave_idx_type c, Complex val)
Definition: CSparse.h:66
Definition: DET.h:34
OCTAVE_API SparseComplexMatrix operator*(const SparseMatrix &, const SparseComplexMatrix &)
Definition: CSparse.cc:7514
OCTAVE_API ComplexMatrix mul_herm(const ComplexMatrix &, const SparseComplexMatrix &)
Definition: CSparse.cc:7550
OCTAVE_API SparseComplexMatrix operator+(const ComplexDiagMatrix &, const SparseMatrix &)
Definition: CSparse.cc:7620
SparseBoolMatrix & insert(const SparseBoolMatrix &a, octave_idx_type r, octave_idx_type c)
Definition: boolSparse.cc:75
SparseBoolMatrix index(const idx_vector &i, bool resize_ok) const
Definition: boolSparse.cc:293
static M ltsolve(const SM &L, const ColumnVector &Q, const M &m)
Definition: eigs-base.cc:80
SparseBoolMatrix squeeze(void) const
Definition: boolSparse.cc:287
SparseComplexMatrix(octave_idx_type r, octave_idx_type c, octave_idx_type num_nz)
Definition: CSparse.h:101
SparseBoolMatrix all(int dim=-1) const
Definition: boolSparse.cc:138
Definition: dMatrix.h:36
MSparse< T > & operator=(const MSparse< T > &a)
Definition: MSparse.h:74
bool operator==(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:550
SparseComplexMatrix(octave_idx_type r, octave_idx_type c, double val)
Definition: CSparse.h:70
SparseMatrix sum(int dim=-1) const
Definition: boolSparse.cc:191
bool any_element_is_nan(void) const
Definition: Sparse.h:663
OCTAVE_API SparseComplexMatrix operator-(const ComplexDiagMatrix &, const SparseMatrix &)
Definition: CSparse.cc:7651
SparseComplexMatrix(const Sparse< Complex > &a)
Definition: CSparse.h:81
template OCTAVE_API std::ostream & operator<<(std::ostream &, const Array< bool > &)
OCTAVE_API ComplexMatrix mul_trans(const ComplexMatrix &, const SparseComplexMatrix &)
Definition: CSparse.cc:7544
OCTAVE_API ComplexMatrix herm_mul(const SparseComplexMatrix &, const ComplexMatrix &)
Definition: CSparse.cc:7580
b
Definition: cellfun.cc:400
static M utsolve(const SM &U, const ColumnVector &Q, const M &m)
Definition: eigs-base.cc:100
for i
Definition: data.cc:5264
OCTAVE_EXPORT octave_value_list error nd deftypefn *const octave_scalar_map err
Definition: error.cc:1049
octave_value operator!(const octave_value &a)
Definition: ov.h:1573
std::complex< double > Complex
Definition: oct-cmplx.h:31
OCTAVE_API SparseComplexMatrix min(const Complex &c, const SparseComplexMatrix &m)
Definition: CSparse.cc:7702
write the output to stdout if nargout is
Definition: load-save.cc:1612
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:87
SparseComplexMatrix(const ComplexMatrix &a)
Definition: CSparse.h:83
dim_vector dv
Definition: sub2ind.cc:263
SparseComplexMatrix(const Array< Complex > &a, const idx_vector &r, const idx_vector &c, octave_idx_type nr=-1, octave_idx_type nc=-1, bool sum_terms=true, octave_idx_type nzm=-1)
Definition: CSparse.h:89
octave::stream os
Definition: file-io.cc:627
where the brackets indicate optional arguments and and character or cell array For character arrays the conversion is repeated for every row
Definition: str2double.cc:342
SparseComplexMatrix(const SparseComplexMatrix &a, const dim_vector &dv)
Definition: CSparse.h:76